particles diffusion and drift

Modified from original

File:
Export:
Mode: Interactive
Commands and Code: Bottom
Created with Highcharts 10.3.1x-coordinateFrequency ofparticlesChart context menuX distribution of red particles-40-30-20-100102030400100200
Created with Highcharts 10.3.1x-coordinateFrequency ofparticlesChart context menuX distribution of yellow particles-40-30-20-100102030400160

WHAT IS IT?

This is a model of particles moving in a closed chamber under the influence of two processes. It is meant to be used as a tool to generate and test basic intuitions about how particles (atoms, ions or molecules) move in a fluid. The model simulates Brownian motion and drift in an electric field. These two processes have very different effects on how particles move and how they are distributed as time passes.

HOW IT WORKS

Brownian motion modelled as a random walk: At every time step (tick), a particle changes its direction randomly from 0 to 259 degrees. It takes a step forward through a randomly chosen fractional distance of less than 1 unit. The distance and time units are arbitrary. The distance unit is the same as a unit of distance in the XY plane.

Drift in an electric field: At every time-step, charged particles experience a fixed increase in velocity in the direction of the electric field. The magnitude of this velocity increase is proportional to the field-strength. Velocity components added in the direction of the field on previous time steps are over-ridden by the last collision. We model this by first computing the random displacement as a result of the last collision and adding a fixed displacement in the direction of the electric field.

The 2D space is set up such that it wraps around along the Y dimension and ends along the X dimension. Topologically it can be imagined as the surface of a cylinder.

There is a blue line that represents a membrane that divides the main chamber into two compartments.

If a particle runs into the membrane or is about to cross the edge in the X direction, it turns around by 180 degrees. If a particle crosses the edge in the Y direction, it appears on the opposite side in the Y direction.

HOW TO USE IT

You can set the "number-of-particles" and turn the "trace-path?" switch ON or OFF. You can also select the number of "types-of-particles" are being modelled, and decide the particle "color-with-charge" to define whether a particle is affected by diffusion alone, or also an electric field. The strength-of-the-field parameter controls how much the charged particle is affected by the field. For simplicity, the field is assumed parallel to the X dimension. (NEED TO FIX NEGATIVE FIELD EFFECT AT LEFT CHAMBER BOUNDARY)

The "trace-path?" switch is useful for viewing the history of particles' paths. It also illustrates how particle motion depends on the processes in play.

Run the model to see how diffusion and drift in an electric field can be modeled using a simple random walk, followed by an additional displacement in the field direction.

THINGS TO NOTICE

One can observe the change in the concentration of particles in a 2D plane along the X and Y dimensions. How does particle motion and their final distribution depend on the processes affecting it?

The graphs show a histogram of the distribution of particles along the X dimension. Notice how the distribution changes over time. Are there differences between particle-types (charged or neutral)? Will it theoretically ever become uniform for any particle type?

THINGS TO TRY

Change the number of particles and see if the time-dependence on the change in the distribution in the X dimension changes.

CONTINUE EDITS FROM HERE

Read the code. Try changing the sequence of steps in the procedures random walk. Why is the sequence important?

EXTENDING THE MODEL

Change the permeability of the membrane such that it becomes probabilistically semi-permeable. In other words, modify the code so that particles can cross the membrane with some probability. Try adding a slider so that you can set this probability.
Is it biologically (unmotivated?) meaningful to model semi-permeability like this?

Advanced: 1. Think about how you can make the movement of particles more realistic for different environments, such as in air or in a fluid outside a neuron. 2. Change how the two/three dimensional space is organized and see if that has any effect on using the random walk to simulate diffusion.

CREDITS AND REFERENCES

The model was created by Sugat Dabholkar for a course that was taught in collaboration with Mehrab Modi.